package fr.cephb.berkeleydb.sort;

import java.util.Comparator;

import com.sleepycat.bind.tuple.LongBinding;
import com.sleepycat.bind.tuple.TupleInput;


public class LongComparator implements Comparator<byte[]>
	{
	private LongBinding binding=new LongBinding();
	
	public LongComparator()
		{
		
		}
	
	@Override
	public int compare(byte[] b1, byte[] b2)
		{
		Long n1=binding.entryToObject(new TupleInput(b1));
		Long n2=binding.entryToObject(new TupleInput(b2));
		return n1.compareTo(n2);
		}
	}
